<?php Yii::app()->clientScript->registerScriptFile('/js/admin/karma.js'); ?>
<div class="span9">
    <div class="content">
        <ul class="breadcrumb">
            <li><?php echo CHtml::link('Админка ', array('default/index')); ?> <span class="divider">/</span></li>
            <li><?php echo CHtml::link(' Параметры кармы пользователя ', array('default/karmaParams')); ?><span class="divider">/</span> </li>
            <li class="active"> <?php echo isset($_GET['id']) ? 'Изменить' : 'Добавить'; ?> </li>
        </ul>
    </div>
    
    <?php echo CHtml::errorSummary($model, 'Пожалуйста исправьте следующие ошибки:'); ?>

    <?php echo CHtml::beginForm(); ?> 
        <div style="float: right; width: 50%">
            <div style="float: left">Уровни <img src="/images/admin/plus_orange.png" class="addLevel" style="cursor: pointer"/>:</div><br/>
            <div class="levelsWrap">
                <?php if(!empty($karmaLevels)) : ?>
                    <?php for($i=0; $i<count($karmaLevels); $i++) : ?>
                        <div>
                            Необходимая карма и вес голоса для уровня <?php echo $i+1; ?>:
                            <img src="/images/admin/deletered.png" class="delButton" style="cursor:pointer" /><br/>
                            Необходимая карма:<br/>
                            <input type="text" name="KarmaLevels[karma][]" value="<?php echo $karmaLevels[$i]['carma']; ?>" /><br/>
                            Вес голоса по достижению значения:<br/>
                            <input type="text" name="KarmaLevels[weight][]" value="<?php echo $karmaLevels[$i]['weight']; ?>" /><br/>
                        </div>
                    <?php endfor; ?>
                <?php endif; ?>
            </div>
        </div>    
        
        <div style="width: 50%">
            <?php echo CHtml::activeLabel($model, 'timeDays'); ?>
            <?php echo CHtml::activeTextField($model, 'timeDays', array('class'=>'activeTextField', 'value'=>$karmaData['timeDays'], 'placeholder'=>$model->getAttributeLabel('timeDays'))); ?>

            <?php echo CHtml::activeLabel($model, 'mesCount'); ?>
            <?php echo CHtml::activeTextField($model, 'mesCount', array('class'=>'activeTextField', 'value'=>$karmaData['mesCount'], 'placeholder'=>$model->getAttributeLabel('mesCount'))); ?>

            <?php echo CHtml::activeLabel($model, 'partnersCount'); ?>
            <?php echo CHtml::activeTextField($model, 'partnersCount', array('class'=>'activeTextField', 'value'=>$karmaData['partnersCount'], 'placeholder'=>$model->getAttributeLabel('partnersCount'))); ?>

            <?php echo CHtml::activeLabel($model, 'revModer'); ?>
            <?php echo CHtml::activeTextField($model, 'revModer', array('class'=>'activeTextField', 'value'=>$karmaData['revModer'], 'placeholder'=>$model->getAttributeLabel('revModer'))); ?>

            <?php echo CHtml::activeLabel($model, 'mesDay_1_5'); ?>
            <?php echo CHtml::activeTextField($model, 'mesDay_1_5', array('class'=>'activeTextField', 'value'=>$karmaData['mesDay_1_5'], 'placeholder'=>$model->getAttributeLabel('mesDay_1_5'))); ?>

            <?php echo CHtml::activeLabel($model, 'mesDay_3'); ?>
            <?php echo CHtml::activeTextField($model, 'mesDay_3', array('class'=>'activeTextField', 'value'=>$karmaData['mesDay_3'], 'placeholder'=>$model->getAttributeLabel('mesDay_3'))); ?>

            <?php echo CHtml::activeLabel($model, 'mesDay_6'); ?>
            <?php echo CHtml::activeTextField($model, 'mesDay_6', array('class'=>'activeTextField', 'value'=>$karmaData['mesDay_6'], 'placeholder'=>$model->getAttributeLabel('mesDay_6'))); ?>

            <?php echo CHtml::activeLabel($model, 'mesDayMore_6'); ?>
            <?php echo CHtml::activeTextField($model, 'mesDayMore_6', array('class'=>'activeTextField', 'value'=>$karmaData['mesDayMore_6'], 'placeholder'=>$model->getAttributeLabel('mesDayMore_6'))); ?>

            <?php echo CHtml::activeLabel($model, 'comDay_1_5'); ?>
            <?php echo CHtml::activeTextField($model, 'comDay_1_5', array('class'=>'activeTextField', 'value'=>$karmaData['comDay_1_5'], 'placeholder'=>$model->getAttributeLabel('comDay_1_5'))); ?>

            <?php echo CHtml::activeLabel($model, 'comDay_3'); ?>
            <?php echo CHtml::activeTextField($model, 'comDay_3', array('class'=>'activeTextField', 'value'=>$karmaData['comDay_3'], 'placeholder'=>$model->getAttributeLabel('comDay_3'))); ?>

            <?php echo CHtml::activeLabel($model, 'comDay_6'); ?>
            <?php echo CHtml::activeTextField($model, 'comDay_6', array('class'=>'activeTextField', 'value'=>$karmaData['comDay_6'], 'placeholder'=>$model->getAttributeLabel('comDay_6'))); ?>

            <?php echo CHtml::activeLabel($model, 'comDayMore_6'); ?>
            <?php echo CHtml::activeTextField($model, 'comDayMore_6', array('class'=>'activeTextField', 'value'=>$karmaData['comDayMore_6'], 'placeholder'=>$model->getAttributeLabel('comDayMore_6'))); ?>
        </div>
        <br/><?php echo CHtml::submitButton('Подтвердить', array('class'=>'btn btn-large btn-primary')); ?>

    <?php echo CHtml::endForm(); ?> 
</div>    